FPL - Implemented import and other house-keeping#33
FPL - Implemented import and other house-keeping#33TimWheeler-SQUP wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
A few things worth a human look before merging: the gameweekData.json renames chip field paths (e.g. chip_plays.0.num_played → chip_plays.bboost) which would break existing dashboards using those fields — this may warrant a major version bump rather than a patch bump. Also, the per-datastream userID removal assumes all existing configs will seamlessly pick up the new global ui.json field, which may need verification. Documentation is also noted as incomplete in the PR description.
Extended reasoning...
Overview
This PR touches 15 files in the FantasyPremierLeague plugin, introducing: import support (indexDefinitions, custom_types, configValidation), three new data streams (classicLeagues, h2hLeagues, h2hLeagueSummary), a post-request script for robust chip data keying, centralised Manager ID in ui.json, and various metadata/cspell updates. The version is bumped from 1.0.2 to 1.0.3.
Security risks
No security risks identified — no credentials, no auth changes, uses a public FPL API with no authentication.
Level of scrutiny
This PR warrants careful human review. The scope is substantial (15 files, new architectural features), and two changes in particular deserve closer inspection before merging:
-
Potential breaking change in gameweekData: The chip_plays field names change from index-based paths () to name-keyed paths (, , etc.). Any existing dashboards referencing the old field names will break. The repo guidelines state a major version bump is required for significant field modifications. A patch bump to 1.0.3 may be insufficient.
-
Centralised userID migration: The per-datastream UI fields are removed from managerHistory, managerInformation, and managerSummary, replaced by a global field. Existing plugin configurations may need to be reconfigured, which could also be considered a breaking change.
Other factors
The PR description notes documentation as incomplete ('Not yet, where should it live?'). The inline bug comments cover several nit-level guideline violations (missing placeholder, prohibited title attributes, missing tags). These are minor, but the breaking change question is the primary reason to defer here.
|
@clarkd - Quite a lot of changes here, but only 3 uses of the plugin. Happy to bump major version or merge breaking changes. |
📋 Summary
Index definitions — gameweeks, classic leagues, and H2H leagues are now indexed as searchable objects using the three custom types already defined in custom_types.json
Centralised Manager ID now it is entered on setup page
Data streams populate league IDs based on Manager ID leagueSummary & h2hLeagueSummary
Robust property names — gameweek chip data is now keyed by chip name (bboost, 3xc, wildcard, freehit) via a post-request script
Config validation — the Manager ID is now validated when saving the plugin, giving immediate feedback if the ID is wrong
Metadata updates to standardise with other plugins
🔗 Related issue(s)
N/A
🧩 Plugin details
Does this PR introduce any breaking changes?
It adds import and changes the data source config screen. Not sure how that works with existing plugins.
Data stream changes should work with existing setup.
📚 Documentation
Not yet, where should it live?
✅ Checklist